﻿using JshRCSWebApi.Infrastructure.Domain.DTO.SysVehicle.VehicleState;
using JshRCSWebApi.Infrastructure.Domain.DTO.SysVehicle;
using JshRCSWebApi.Service.SysVehicle;
using Microsoft.AspNetCore.Mvc;
using JshRCSWebApi.Infrastructure.Domain.DTO.SysVehicle.VehicleTask;

namespace JshRCSWebApi.API.Controllers.SysVehicle
{
    public class VehicleTaskController : BaseController
    {
        private readonly VehicleTaskService _vehicleTaskService;
        public VehicleTaskController(IHttpContextAccessor httpContextAccessor, VehicleTaskService vehicleTaskService) : base(httpContextAccessor)
        {
            _vehicleTaskService = vehicleTaskService;
        }
        /// <summary>
        /// 路径导航 3051           
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_gotarget_req(RequestDTO<robot_task_gotarget_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_gotarget_req(requestDTO);

        /// <summary>
        /// 高级路径导航 3051           
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_gotarget_senior_req(RequestDTO<robot_task_gotarget_senior_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_gotarget_senior_req(requestDTO);

        /// <summary>
        /// 指定路径导航 3066            
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_gotargetlist_req(RequestDTO<robot_task_gotargetlist_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_gotargetlist_req(requestDTO);

        /// <summary>
        /// 平动 3055             
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_translate_req(RequestDTO<robot_task_translate_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_translate_req(requestDTO);

        /// <summary>
        /// 转动 3056              
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_turn_req(RequestDTO<robot_task_turn_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_turn_req(requestDTO);

        /// <summary>
        /// 圆弧运动 3058               
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_circular_req(RequestDTO<robot_task_circular_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_circular_req(requestDTO);

        /// <summary>
        /// 启用和禁用线路 3059                
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_path_req(RequestDTO<robot_task_path_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_path_req(requestDTO);

        /// <summary>
        /// 托盘旋转 3057                 
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_spin_req(RequestDTO<robot_task_spin_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_spin_req(requestDTO);

        /// <summary>
        /// 暂停当前导航 3001                  
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_pause_req(RequestDTO requestDTO)
            => await _vehicleTaskService.robot_task_pause_req(requestDTO);

        /// <summary>
        /// 继续当前导航 3002                   
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_resume_req(RequestDTO requestDTO)
            => await _vehicleTaskService.robot_task_resume_req(requestDTO);

        /// <summary>
        /// 取消当前导航 3003                    
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_cancel_req(RequestDTO requestDTO)
            => await _vehicleTaskService.robot_task_cancel_req(requestDTO);

        /// <summary>
        /// 查询机器人任务链 3101                  
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_tasklist_status_req(RequestDTO<robot_tasklist_status_DTO> requestDTO)
            => await _vehicleTaskService.robot_tasklist_status_req(requestDTO);

        /// <summary>
        /// 查询机器人所有任务链 3115                     
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_tasklist_list_req(RequestDTO requestDTO)
            => await _vehicleTaskService.robot_tasklist_list_req(requestDTO);

        /// <summary>
        /// 执行预存任务链 3106                   
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_tasklist_name_req(RequestDTO<robot_tasklist_name_DTO> requestDTO)
            => await _vehicleTaskService.robot_tasklist_name_req(requestDTO);

        /// <summary>
        /// 获取路径导航的路径 3053                    
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_target_path_req(RequestDTO<robot_task_target_path_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_target_path_req(requestDTO);

        /// <summary>
        /// 根据任务id清除指定导航路径 3068                     
        /// </summary>
        /// <param name="requestDTO"></param>
        /// <returns></returns>
        [HttpPost]
        public async Task<ApiResult> robot_task_safeclearmovements_req(RequestDTO<robot_task_safeclearmovements_DTO> requestDTO)
            => await _vehicleTaskService.robot_task_safeclearmovements_req(requestDTO);
    }
}
